def success(data=None):
    return {
        "code": 0,
        "msg": "OK",
        "data": data
    }


def fail(msg, code=1):
    return {
        "code": code,
        "msg": msg
    }


def success_page(data: [], total=0, per_page=10, page=1):
    return {
        "code": 0,
        "msg": "OK",
        "data": data,
        "pagination": {
            "total": total,
            "perPage": per_page,
            "page": page
        }
    }
